<?php
	require_once $_SERVER ['DOCUMENT_ROOT']."/bloodPet/application/config/control.php";
    require_once $_SERVER ['DOCUMENT_ROOT'].BASE_PROJECT_PATH."/application/config/database.php";
	
	class DBConn {
		private $conn; 
		public function DBConn($account, $password, $database) {
			$this->open( $account, $password, $database);
		}
		
		public function open($account, $password, $database) {
			$this ->conn = @mysql_pconnect(HOST, $account ,$password);
			@mysql_query("SET NAMES utf8");
			@mysql_query("SET CHARACTER_SET_RESULTS= utf8", $this->conn);
			@mysql_select_db($database);
		}
		
		public function getConn(){
			return $this ->conn;
		}
		
		public function close(){
			@mysql_close($this->conn);
		}
	}
?>